package edu.szu.huhanpeng.doodlingFight.controller.dataController.updateActioner 
{
	import edu.szu.huhanpeng.doodlingFight.model.data.GameData;
	import edu.szu.huhanpeng.doodlingFight.model.GameProxy;
	import edu.szu.huhanpeng.doodlingFight.model.ScoreProxy;
	import org.puremvc.as3.interfaces.ICommand;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.interfaces.INotifier;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	/**
	 * ...
	 * @author Huhanpeng
	 */
	public class UpdateActionerDc extends SimpleCommand implements ICommand, INotifier 
	{
		
		override public function execute(note:INotification):void 
		{
			var gameProxy:GameProxy = facade.retrieveProxy( GameProxy.NAME ) as GameProxy;
			var scoreProxy:ScoreProxy = facade.retrieveProxy( ScoreProxy.NAME ) as ScoreProxy;
			
			switch ( gameProxy.actingPlayer ) 
			{
				case GameData.P_ONE:
					scoreProxy.setData( gameProxy.pOneScoreData );
				break;
				case GameData.P_TWO:
					scoreProxy.setData( gameProxy.pTwoScoreData );
				default:
			}
			
			scoreProxy.clean();
		}
		
	}

}